View Javadoc

1   // AccessController.java, created Thu Jul  4  4:50:03 2002 by joewhaley
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.ClassLib.pa.java.security;
5   
6   /***
7    * AccessController
8    *
9    * @author  John Whaley <jwhaley@alum.mit.edu>
10   * @version $Id: AccessController.java 1451 2004-03-09 06:27:08Z jwhaley $
11   */
12  abstract class AccessController {
13  
14      public static Object doPrivileged(java.security.PrivilegedAction action) {
15          // TODO: set privilege level
16          return action.run();
17      }
18      public static Object doPrivileged(java.security.PrivilegedAction action,
19                                        java.security.AccessControlContext context) {
20          // TODO: set privilege level
21          return action.run();
22      }
23      public static Object doPrivileged(java.security.PrivilegedExceptionAction action)
24          throws java.security.PrivilegedActionException {
25          // TODO: set privilege level
26          try {
27              return action.run();
28          } catch (RuntimeException x) {
29              throw x;
30          } catch (Exception x) {
31              throw new java.security.PrivilegedActionException(x);
32          }
33      }
34      public static Object doPrivileged(java.security.PrivilegedExceptionAction action,
35                                        java.security.AccessControlContext context)
36          throws java.security.PrivilegedActionException {
37          // TODO: set privilege level
38          try {
39              return action.run();
40          } catch (RuntimeException x) {
41              throw x;
42          } catch (Exception x) {
43              throw new java.security.PrivilegedActionException(x);
44          }
45      }
46      private static java.security.AccessControlContext getStackAccessControlContext() {
47          // TODO
48          return null;
49      }
50      static java.security.AccessControlContext getInheritedAccessControlContext() {
51          // TODO
52          return null;
53      }
54  
55      //public static final jq_Class _class = (jq_Class)PrimordialClassLoader.loader.getOrCreateBSType("Ljava/security/AccessController;");
56  }